//
//  Content.m
//  __PRODUCTNAME__
//
//  Created by Hanlingyu on 16/08/30
//  Copyright (c) ltq. All rights reserved.
//

#import "Content.h"
#import "Banner.h"
#import "Recommend.h"

@implementation Content

- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"banner"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Banner *banner = [Banner modelWithDic:dic];
            [array addObject:banner];
        }
        _banner = array;
    } else if ([key isEqualToString:@"recommend"]){
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Recommend *recommend = [Recommend modelWithDic:dic];
            [array addObject:recommend];
        }
        _recommend = array;
        
    } else {
        [super setValue:value forKey:key];
    }
}







+ (NSDictionary *)objectClassInArray{
    return @{@"banner" : [Banner class], @"recommend" : [Recommend class]};
}

@end
